/**
 * 默认的loader配置
 */
const loaders = [{
  test: /\.(js|mjs|jsx|ts|tsx)$/,
  use: [{
    loader: 'babel-loader',
  },
  ],
  exclude: /node_modules/
},
{
  test: /\.css$/,
  use: [{
    loader: "style-loader"
  }, {
    loader: "css-loader",
    options: {
      modules: {
        localIdentName: "[name]-[local]-[hash:5]"
      }
    }
  }],
}, {
  test: /\.less$/,
  use: [{
    loader: "style-loader"
  }, {
    loader: "css-loader",
    options: {
      modules: {
        localIdentName: "[name]-[local]-[hash:5]",
      },
      importLoaders: 2,
    }
  }, {
    loader: 'postcss-loader',
    options: {
      postcssOptions: {
        plugins: [
          ['postcss-preset-env']
        ],
      },
    }
  },
    "less-loader"
  ]
}, {
  test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
  type: 'asset/resource'
},
]

module.exports = loaders